<div class="page-header">
	<div class="page-title"><h3><?php echo Yii::t('app', 'Pricing') ?></h3></div>
</div>

<h4><?php echo Yii::t('app', 'Add Package') ?></h4>
<?php $this->renderPartial('package/form', array('item'=>$newItem)) ?>

<h4><?php echo Yii::t('app', 'Packages') ?></h4>
<?php $form = $this->beginWidget('CActiveForm', array(
	'id'=>'edit-form',
	'method'=>'post',
	'enableClientValidation'=>true,
)); ?>
<div class="grid-view">
<table class="table table-bordered table-hover">
	<thead>
	<tr>
		<th rowspan="2"><?php echo Yii::t('app', 'Content') ?></th>
		<th colspan="2"><?php echo Yii::t('app', 'Point setting') ?></th>
		<th rowspan="2" class="span2"></th>
	</tr>
	<tr>
		<th><?php echo Yii::t('app', 'Male') ?></th>
		<th><?php echo Yii::t('app', 'Female') ?></th>
	</tr>
	</thead>
	<tbody>
	<?php $i=1; foreach($items as $item): ?>
		<?php $class = $i % 2 == 0 ? 'even' : 'odd'; ?>
		<?php $key = $item->isNewRecord ? "new_".$i : $item->id; ?>
		<tr class="<?php echo $class ?>">
			<td>
				<?php echo $form->textField($item, 'name', array('name'=>"PointPackage[$key][name]", 'class'=>'span12')); ?>
				<?php echo $form->error($item, 'name'); ?>
			</td>
			<td>
				<?php echo $form->textField($item, 'male_point', array('name'=>"PointPackage[$key][male_point]", 'class'=>'span12')); ?>
				<?php echo $form->error($item, 'male_point'); ?>
			</td>
			<td>
				<?php echo $form->textField($item, 'female_point', array('name'=>"PointPackage[$key][female_point]", 'class'=>'span12')); ?>
				<?php echo $form->error($item, 'female_point'); ?>
			</td>
			<td>
				<a title="Delete" href="<?php echo $this->createUrl('delete', array('id'=>$item->id)) ?>" class="btn_delete btn btn-danger">
					<?php echo Yii::t('app', 'Delete') ?>
				</a>
			</td>	
		</tr>
	<?php $i++; endforeach; ?>
	</tbody>
</table>
</div><!--//gridview -->

<p>
	<input type="hidden" name="action" value="update" />
	<input type="submit" class="btn btn-primary" id="discount-submit" value="<?php echo Yii::t('app', 'Save') ?>" />
</p><!--//button-->
<?php $this->endWidget(); ?>

<style>
th { text-align: center !important; vertical-align: middle !important;}
</style>